Opacity based interference texture

ABSTRACT

A method and apparatus for generating a colored or shaded texture for images to be displayed on a display device or printed. The method includes the step of providing a plurality of shape elements, each of which defines a surface. Each of the shape elements also has an associated opacity which varies across its surface. The shape elements are arranged in an overlapping fashion and then rendered for output to a printer or display device. The overlapping opacities and opacity gradients provide a visually interesting colored or shaded texture. Preferably the shape elements are circles and the opacity is applied as a cone-shaped function tapering to zero opacity at its edges.

FIELD OF INVENTION

[0001] The present invention relates to a method of generating acoloured or shaded texture to be displayed on a display device orprinter.

[0002] The invention has been developed primarily for use in generatingbackground effects for displayed or printed matter. However, it will beappreciated that the textures generated may be applied to any suitablesubject, including sprites, lettering, and the surfaces ofthree-dimensional representations.

BACKGROUND

[0003] A number of prior art systems have been developed to generatevarious types of textures. Typically, these systems involve modulationof existing functions, such as Perlin noise functions,reaction-diffusion or vector fields. Alternatively, an existing imagemay be modulated using these or similar functions. However, suchapproaches tend to be relatively processor intensive, which may be adisadvantage where speed is important.

[0004] There is an ongoing interest in generating visually interestingtextures in a relatively simple, fast manner, for use with all types oftext and graphics manipulation and display. In particular, there is anongoing need for visually interesting parameterised textures which canbe applied to font characters and relatively easily customised forparticular applications without the need for large amounts of manualinput from a user.

SUMMARY OF INVENTION

[0005] The present invention provides a method of generating a colouredor shaded texture for images to be displayed on a display device orprinted, the method including the steps of:

[0006] (a) providing a plurality of shape elements, each shape elementdefining a surface;

[0007] (b) providing each of the shape elements with an opacity whichvaries over its surface;

[0008] (c) arranging the shape elements in an overlapping fashion; and

[0009] (d) rendering the shape elements for output to a printer, storageor a display device, such that the overlapping opacities generate acoloured or shaded texture.

[0010] Preferably the shape elements are regular geometric shapes, andare all of the same general shape. It is also preferred that the shapeelements be of a similar size. In a particularly preferred embodiment,the shape elements are circles.

[0011] Preferably, the shape elements are positioned at predeterminedpoints within a closed curve, such as an outline of a font character.

[0012] Other aspects of the invention are described in the followingdetailed description.

BRIEF DESCRIPTION OF DRAWINGS

[0013] Preferred embodiments of the invention will now be described, byway of example only, with reference to the accompanying drawings, inwhich:

[0014]FIG. 1 is a surface plot showing opacity values across a unitsquare region, determined from a circle centred at one corner withopacity varying from 1 at its centre to 0 at its perimeter;

[0015]FIG. 2 is a surface plot similar to that in FIG. 1, determinedfrom two circles centred at adjacent corners;

[0016]FIG. 3 is a surface plot similar to that shown in FIGS. 1 and 2,determined from three circles centred at three corners;

[0017]FIG. 4 is a surface plot similar to that shown in FIGS. 1, 2, and3, determined from four circles centred at the corners;

[0018]FIG. 5 shows a surface plot of opacity values across a unit squareregion in which the focus is 0;

[0019]FIG. 6 shows a surface plot similar to that shown in FIG. 5, inwhich the focus is 0.5;

[0020]FIG. 7 shows a shaded texture overlayed with a flat shaded letter“L” (designated 21), generated in accordance with the preferredembodiment of the invention;

[0021]FIG. 8 is a shaded texture similar to that shown in FIG. 7, withthe overlapping circles rendered using an OVER operator;

[0022]FIG. 9 is a shaded texture similar to that shown in FIG. 8, with afocus of 0.95;

[0023]FIG. 10 is a shaded texture similar to that shown in FIGS. 8 and9, with a focus of 1.5, and with the opacities rendered using a PLUSWoperator;

[0024]FIG. 11 is a shaded texture similar to that shown in FIGS. 8 to10, in which opacity varies from 0.75 at the focal point to 0.25 at theperimeters of the shapes;

[0025]FIG. 12 is a shaded texture similar to that shown in FIGS. 8 to11, in which opacity varies from 0.25 at the focal point to 0.75 at theperimeters of the shapes;

[0026]FIG. 13 is a schematic diagram of computer apparatus for use inimplementing preferred embodiments of the invention;

[0027]FIG. 14 is a flowchart showing the steps involved in implementinga preferred form of the invention; and

[0028]FIG. 15 is font character “m” to which there has been applied ashaded texture in accordance with the preferred embodiment.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

[0029] Referring to the drawings, the preferred embodiment of theinvention provides a method of generating a coloured or shaded texturefor images to be displayed on a display device or printer. The basicsteps in performing the preferred embodiment are set out in theflowchart 1400 of FIG. 14. Initially, in step 1401, a plurality of shapeelements are provided. Each shape element defines a surface, and in thepreferred form, is a regular polygon or circle. Each of the shapedelements is provided with an opacity in step 1402, and the shapeelements are then arranged in an overlapping fashion in step 1403.Usually, the area within which the shape elements are arranged will bebounded by a closed curve, such as the edges of a font character.Alternatively, if the preferred embodiment is being used as a means ofgenerating a background texture, no boundary other than the edges of theimage itself will apply.

[0030] The overlapping shape elements are then rendered in step 1404 foroutput to a printer 1405, display 1407 or memory 1406. It will beappreciated that each of components 1405, 1406 and 1407 are implementedon a computer system, such as that discussed below in relation to FIG.13.

[0031] In the preferred, coloured embodiments, a coloured texture isgenerated by means of interference in colour space when overlappingshapes of varying opacity are composited. In this way, the resultanttexture is effectively encoded in the colour (or shade) and opacity ofthe shapes, and is not realised until rendering.

[0032] The method requires that a plurality of overlapping shapes beprovided, thereby to ensure the requisite interference. Typically, theshape elements are regular geometric shapes, and will usually be ofuniform size and shape. However, different sizes and shapes may be mixedto provide varying visually interesting textures.

[0033] As shown in the various figures, it is particularly desirablethat the shape elements be circles, although other shape elements suchas squares, hexagons or other regular polygons (not shown) may be usedto provide different textures.

[0034] Each shape has associated with it a focal point 1 definedrelative to its perimeter. As shown in FIGS. 5 and 6, maximum opacityusually occurs at the focal point 1, and decreases towards a perimeter 2of the circle. Opacity is shown on a vertical scale 4. As shown in FIG.6, moving the focal point 1 towards the perimeter 2 skews the opacitywith relation to the unit square, which, when composited with othershape elements, causes different visually interesting textures to begenerated.

[0035] The opacity of each shape can vary between its focal point 1 andperimeter 2 according to any suitable function, although linearinterpolation is used in the preferred embodiments. The use of linearinterpolation helps to ensure a relatively consistent opacity valueacross the final texture.

[0036] Consistency of the opacity is also improved when the shapes arerelatively evenly distributed across the texture region, and is ofparticular importance if the texture is to be used for furthercompositing operations. FIGS. 1 to 4 show the effects of overlayingopacities of neighbouring circles, each having a focus of 0. In FIG. 1,a circle 6 (only one quarter of which is shown) disposed in thehorizontal plane and centred at a first corner 8 of a unit square 10exhibits a relatively steep opacity gradient 12. FIG. 2 adds a circle toan adjacent corner, 14, thereby reducing the overall opacitydifferential across the unit square as a whole. FIG. 3 adds yet anothercircle, whilst FIG. 4 adds a final circle to the last free corner of theunit square 10. As shown in FIG. 4, the effect of multiple overlappingcircles having relatively constant spacing and linear opacity gradientstends to produce a relatively constant opacity across the area in whichthe circles are disposed. There are, in this case, some minor “bumps”associated with the adding of the overlapping circles. However, these donot depart greatly from an opacity of 1. For example, a central bump 16with an opacity of about 1.2 is the furthest deviation from an opacityof 1.0 across the whole unit square. An algorithm such as mesh fitting,well known to those skilled in the art, may be used to generatereasonably equidistant points at which to place the shape elements.

[0037] A focus parameter dictates the relationship of the focal point 1to its associated perimeter 2. In a preferred embodiment, a defaultvalue of 0 indicates that the focal point 1 is at the circle's centre,as shown in FIG. 5, whilst a value of 1 indicates that the focal point 1is on the perimeter of the circle. FIG. 6 shows the case where the focalpoint 1 is shifted 0.25 units towards the perimeter 2.

[0038] In the preferred form, the available focus parameter values varybetween the centre of the circle and the perimeter 2, although in otherembodiments the focus parameters can extend beyond this range to allowfocal points outside the perimeter 2. Varying the focus parameterresults in colour and opacity discontinuities which can give animpression of substantial shape not offered by other texture-generationalgorithms. For example, in FIG. 9 there are shown discontinuities 18 inbrightness as the colours and opacities “wrap” around. This occurs ascomposited opacities which exceed a predetermined maximum opacityrespectively are remapped to a lower opacity. An analogous colour“wrapping” takes place as colours are composited in combination withvarying opacities. For focal points 1 which exceed a focus parameter of1.0, this “wrapping” can become more noticeable, as shown in FIG. 10.The sharp blackwhite discontinuities 20 are examples of this. In FIGS. 7to 10, there appear regions of gradually changing shade 22, which implysolidity or three-dimensionality.

[0039] The colour of each component shape is independent of the opacityfunction used, and may be a flat colour, a colour blend, or even ashade. Flat colour is preferred due to ease of implementation, althoughother visually interesting patterns may be achieved by varying thecolours of the various shape elements. Various compositing operators maybe used to calculate overlapping shape opacity, and include thosetypically used in computer graphics, such as: OVER (FIGS. 8 and 12),XOR, PLUSC (FIGS. 7, 9, 11), and PLUSW (FIG. 10). It will be appreciatedthat the PLUSC operator causes a colour component to clamp on overflow,whilst the PLUSW operator results in wrapping of the colour component onoverflow. The PLUSW operator is of particular interest, because itintroduces colour discontinuity resulting from colour wrapping withoutintroducing opacity discontinuities. This is why the texture in FIG. 10appears smoother, as shown in region 23, without the opacitydiscontinuities introduced by other operators.

[0040] Referring to FIG. 11, there is shown a texture generated by themethod of the invention, whereby the opacity at the focal point is 0.75,and the opacity of the perimeter is 0.25. This results in definiteopacity discontinuities 24 at the edges of circles, because the opacityof each circle does not taper to 0 at the perimeter. FIG. 12 illustratesa similar arrangement, in which the opacity is 0.75 at the perimeter and0.25 at the focal point, composited using an OVER operator. Therelatively high opacity at the edge of each circle generates even moredistinct opacity discontinuities 26 than are shown in FIG. 11. Theseexamples demonstrate the quite different effects which can be generatedby altering a relatively small number of parameters.

[0041] The colour space in which the overlapping shapes are rendered hasa direct bearing on the resultant texture. CIE L*a*b*, a colour spacebased on the human eye's sensitivity to colour, is the preferred choiceof colour space, as it results in colours combining in a non-intuitiveway to produce visually interesting results. However, the method willwork for other colour spaces commonly used in computer graphics, such asRGB or CMY, and can give visually different results for each.

[0042] Varying any of the many perimeters of the shape elements willcorrespondingly vary the resultant texture. Accordingly, the size of theshape elements, the geometric shapes represented, the density of theshape elements, the opacities and opacity gradients as well as thecolour space and compositing operators, can be selected and altered atwill to generate interesting textures.

[0043] In a particularly preferred embodiment, the shaded texturedescribed is applied within a closed curve defined by a boundary. Oneparticular application of this embodiment is shown in FIG. 15, in whichan outline 1500 of a font character “m” has been filled with a texture1501 generated in accordance with one of the preferred embodimentsdescribed above. The shape elements (circles 1502 in this embodiment)are positioned within the outline 1500, either randomly or by means of aknown point distributing method such as wave-propagation from boundarypoints. It will be appreciated that the relatively low processorrequirements for filling the outline of a font character means that fonttextures can be generated and manipulated by users “on the fly”. Also,new texture parameters falling within the scope of the present inventioncan be defined and immediately applied to existing text characters, orto text characters immediately as they are typed or otherwise input byan operator.

[0044] The preferred embodiments of the invention are typicallyimplemented as a computer application program hosted on the Windows™operating system developed by the Microsoft Corporation. However, thoseskilled in the art will recognise that the described embodiment can beimplemented on computer systems hosted by other operating systems. Forexample, the respective embodiments can be performed on computer systemsrunning Unix, OS/2, and DOS. The application program has a userinterface that includes menu items and controls that respond to mouseand keyboard operations. The application program has the ability totransmit data to one or more printers either directly connected to thehost computer or accessed over a network. The application program alsohas the ability to transmit and receive data to a connected digitalcommunications network (for example, the internet).

[0045] The preferred embodiment of the invention can be practiced usinga conventional general-purpose computer system, such as the computersystem 1340 shown in FIG. 13. The application program is implemented assoftware executed on the computer system 1340.

[0046] The computer system 1340 comprises a computer module 1341, inputdevices such as a keyboard 1342 and mouse 1343, and output devicesincluding a printer 1357 and a display device 1356. Amodulator/demodulator (modem) transceiver device 1352 is used by thecomputer module 1341 for communicating to and from a communicationsnetwork, which is accessed via a telephone line or other functionalmedium. The modem 1352 can be used to attain access to the internet, andother network systems.

[0047] The computer module 1341 typically includes at least oneprocessor unit 1345, a memory unit 1346 formed from semiconductor randomaccess memory (RAM) and read only memory (ROM), input/output (I/O)interfaces including a video interface 1347 and an I/O interface 1348for the keyboard 1342 and mouse 1343.

[0048] A storage device 1349 is provided and typically includes a harddisk drive 1353 and a floppy disk drive 1354. A CD-ROM drive 1355 istypically provided as a non-volatile source of data. The components 1345to 1349 and 1353 to 1355 of the computer module 1341 communicate via aninterconnecting bus 1350 in a manner which results in a conventionalmode of operation of a computer system 1340 as is well known to those inthe relevant art. Examples of computers on which the embodiments can bepracticed include IBM-PC and compatibles, and some sparcstations.

[0049] Typically the application program of the preferred embodiment isstored on the hard disk drive 1353 and controlled using the processor1345. Intermediate storage of the program, print list and any datafetched from the network can be accomplished using the semiconductormemory 1346, in concert with the hard disk drive 1353 as required. Insome instances, the application program can be supplied to the userencoded on a CD-ROM or floppy disc, or alternatively can be read by theuser from the network by the modem device 1352.

[0050] A major advantage of the present invention is that the generatedtextures do not rely upon modulation of existing functions, such asPerlin noise functions, reaction-diffusion, or vector fields.Furthermore, source images for use with such modulation are notrequired, which results in the method requiring relatively little in theway of memory or processor resources when implemented on a computersystem. As well as the visually interesting results obtainable by theinvention, the potential reduction in computer resources provides anadditional advantage over prior art coloured or shaded texturegeneration schemes.

[0051] Although the invention has been described with reference to anumber of specific examples, it will be appreciated by those skilled inthe art that the invention may be embodied in many other forms.

The claims defining the invention are as follows:
 1. A method ofgenerating a coloured or shaded texture for images to be displayed on adisplay device or printed, the method including the steps of: (a)providing a plurality of shape elements, each shape element defining asurface; (b) providing each of the shape elements with an opacity whichvaries over its surface; (c) arranging the shape elements in anoverlapping fashion; and (d) rendering the shade elements for output toa printer or display device, such that the overlapping opacitiesgenerate a coloured or shaded texture.
 2. A method according to claim 1,wherein the shape elements are regular geometric shapes.
 3. A methodaccording to claim 2, wherein each of the shape elements is of the samegeneral shape.
 4. A method according to claim 2, wherein the shapeelements are of a similar size.
 5. A method according to claim 4,wherein the shape elements are circles.
 6. A method according to claim4, wherein the shape elements include squares, hexagons, or otherregular polygons.
 7. A method according to claim 1, further includingthe step of assigning a focal point to each of the shape elements,wherein the opacity of each shape varies with distance from the focalpoint.
 8. A method according to claim 7, wherein each focal point islocated within its associated shape element.
 9. A method according toclaim 8, wherein each focal point is located at or adjacent to a centreof its associated shape element.
 10. A method according to claim 7,wherein the opacity at any given point within each shape element isdetermined by the distance of that point from the focal point.
 11. Amethod according to claim 7, wherein opacity of each shape elementvaries between the focal point and the perimeter of the shape element inaccordance with a predetermined function.
 12. A method according toclaim 10, wherein the predetermined function is exponential or linear.13. A method according claim 1, wherein at least some of the shapeelements have a colour component associated with them.
 14. A methodaccording to claim 13, wherein the colour components vary from shapeelement to shape element.
 15. A method according to claim 13, whereinthe colour component of each shape element varies across its surface.16. A method according to claim 13, further including the step ofvarying the colour components of the shape elements over time, andperiodically rendering the shape elements.
 17. A method according toclaim 16, wherein the colour components are varied in a cyclic fashion.18. A method according to claim 17, wherein a period associated with thecyclic colour change is selected at random for each shape element.
 19. Amethod according to claim 1, further including the step of varying theopacity of one or more of the shape elements over time, and periodicallyrendering the shape elements.
 20. A method according to claim 16,wherein the opacity is varied in a cyclic fashion.
 21. A methodaccording to claim 17, wherein a period associated with the cyclicopacity change is selected at random for each shape element.
 22. Amethod according to claim 1, further including the step of applying thecoloured or shaded texture within a boundary defined by a closed curve.23. A method according to claim 22, wherein the closed curve is definedby a font character outline.
 24. Apparatus for generating a coloured orshaded texture for images to be displayed on a display device orprinted, the apparatus including: (a) delivery means for providing aplurality of shape elements, each of the shape elements defining asurface and having an opacity which varies across that surface; (b)arrangement means for arranging the shape elements in an overlappingfashion on a background page; (c) rendering means for rendering theshape elements such that the overlapping opacities generate a colouredor shaded texture; (d) output means for outputting the coloured orshaded texture to a printer or display device.
 25. Apparatus accordingto claim 24, wherein the shape elements are regular geometric shapes.26. Apparatus according to claim 24, wherein the shape elements arecircles.
 27. Apparatus according to claim 22, further includingassignment means for assigning a focal point to each of the shapeelements, such that the opacity of each shape element varies withdistance form the focal point.
 28. Apparatus according to claim 27,wherein the assignment means assign the focal points to areas within therespective shape elements.
 29. A method of producing a printed productincluding a laminar substrate formed from paper, card or otherreproduction medium, the method including the steps of: (a) providing aplurality of shape elements, each shape element defining a surface; (b)providing each of the shape elements with an opacity which varies acrossits surface; (c) arranging the shape elements in an overlapping fashion;(d) rendering the shape elements such that the overlapping opacitiesgenerate a coloured or shaded texture; and (e) printing or otherwiseapplying otherwise applied the coloured or shaded texture to the laminarsubstrate.
 30. A computer storage medium bearing one or more computersoftware programs for execution on a computer, the computer softwareprogram or programs including compiled or uncompiled softwareinstructions for implementing a method of generating a coloured orshaded texture to be displayed on a display device, stored or printed,including instructions for implementing the following steps: (a)providing a plurality of shape elements, each shape element defining asurface; (b) providing each of the shape elements with an opacity whichvaries across its surface; (c) arranging the shape elements in anoverlapping fashion; (d) rendering the shape elements such that theoverlapping opacities generate a coloured or shaded texture.
 31. Acomputer storage medium according to claim 28, wherein the program orprograms stored thereon include instructions for implementing theadditional step of displaying the coloured or shaded texture on adisplay device associated with the computer, storing the coloured orshaded texture on storage means associated with the computer or printingthe coloured or shaded texture on a printer associated with thecomputer.